<script>
import { defineComponent,  h } from "vue";
export default defineComponent({
  props: ["day", "dateList"],
  setup(props) {
    let { day, dateList } = props;
    const render = () => {
        let classObj = {}
        let childList = []
        dateList.forEach(item => {
            if(day === item.time) {
                childList = item.list.map(i => h('p', i))
                item.state === 'finish' ? classObj.finish = true : classObj.unfinish = true
                classObj.hasState = true
            }
        })
        return h('div', {class: classObj}, [day.split('-')[2], childList.length ? h('div', {class: 'toolTip'}, childList) : '' ])
    }
    return render;
  }
});
</script>
